package thread;

public class Producer extends Thread{
	private Stack stack;
//	共享数据，工具方法，用static，否则都不用，面向对象编程，少用static
	public Producer (Stack stack){
		this.stack=stack;
	}
	@Override
	public void run() {
		while(true){
			char c = (char)(Math.random()*26+'a');
			stack.push(c);
		}
	}
}
